package com.zhongkeruan.user.vo;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
@Entity
@Table(name="t_premission")
public class Premission implements Serializable {

	private static final long serialVersionUID = -1701876548952793366L;
	@Id
	@GeneratedValue
	private Long id;
	
	private String name;
	
	private String resourceType;
	
	private String url;
	
	private String premission;
	
	private Long parentId;
	
	private Boolean available = false;
	
	@ManyToMany
	@JoinTable(name="t_role_premission",joinColumns={@JoinColumn(name="premissionId")},
	inverseJoinColumns={@JoinColumn(name="roleId")})
	private List<Role> roles;

	public Premission() {
		super();
	}

	public Premission(Long id, String name, String resourceType, String url, String premission,
			Long parentId, Boolean available, List<Role> roles) {
		super();
		this.id = id;
		this.name = name;
		this.resourceType = resourceType;
		this.url = url;
		this.premission = premission;
		this.parentId = parentId;
		this.available = available;
		this.roles = roles;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getResourceType() {
		return resourceType;
	}

	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getPremission() {
		return premission;
	}

	public void setPremission(String premission) {
		this.premission = premission;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public Boolean getAvailable() {
		return available;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}

	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}
}
